import { http } from '@/utils/request'
import type { AttrData } from '@/api/types'

export const reqAttrList = (category1Id: string, category2Id: string, category3Id: string) => {
  return http<AttrData[]>(
    `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
    'GET'
  )
}

export const reqAddAttr = (data: AttrData) => {
  return http('/admin/product/saveAttrInfo', 'POST', data)
}

export const reqDelAttr = (id: number) => {
  return http(`/admin/product/deleteAttr/${id}`, 'DELETE')
}
